<%--
  Created by IntelliJ IDEA.
  User: TLY
  Date: 2022/12/8
  Time: 11:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="./common/taglibs.jsp" %>
${jquery_js}
${validate_jquery_js}
${form_jquery_js}
<html>
<head>
    <title>理发店业务管理系统</title>
    <link type="text/css" rel="stylesheet" href="${ctx}/css/style.css"/>
    <script type="text/javascript" src="${ctx}/scripts/index.js"></script>

</head>
<body>
<div id="header" class="wrap">

    <div class="navbar">
        <ul class="clearfix">
            <li><a href="${ctx}/index.jsp">首页</a></li>
            <li class="current"><a href="${ctx}/user">会员管理</a></li>
            <li><a href="${ctx}/pageproduct">职工管理</a></li>
            <li><a href="${ctx}/orderquery">订单管理</a></li>
        </ul>
    </div>
</div>
<div id="childNav">
    <div class="welcome wrap">
        管理员${admin.name}您好，欢迎回到管理后台。
    </div>
</div>

<div id="main" class="wrap">
    <div id="menu-mng" class="lefter">
        <div class="box">
            <dl>
                <dt><a href="${ctx}/user/getpageusers">会员管理</a></dt>
                <dd><em></em><a href="${ctx}/user/adduser">新增会员</a></dd>
                <dt>职工管理</dt>
                <dd><em></em><a href="${ctx}/pageproductclass">新增职工</a></dd>
                <dt>订单管理</dt>
                <dd><em></em><a href="${ctx}/pageproductclass">新增职工</a></dd>
            </dl>
        </div>
    </div>
    <div class="main">
        <h2>添加订单</h2>
        <div class="manage">
            <form action="#" id="myform">
                <table class="form">

                    <tr>
                        <td class="field">会员id(*)：</td>
                        <td><input type="text" class="text" name="userid" id="userid" value="" required/></td>
                    </tr>


                    <tr>
                        <td class="field">选择消费项目(*)：</td>
                        <td>
                            <c:forEach items="${skills}" var="i">
                                <p> <input type="checkbox" name="skill.skillid" value="${i.skillid}" />${i.skillname}</p>

                            </c:forEach>

                        </td>


                    </tr>


                    <tr>
                        <td class="field">选择职工(*)：</td>
                        <td>
                            <select name="staff.staffid" id="staff.staffid" >
                                <option value="">请选择</option>
                                <c:forEach items="${staffs}" var="i">
                                    <option value="${i.staffid}" >${i.staffname}</option>

                                </c:forEach>

                            </select>

                        </td>
                    </tr>



                    <tr>
                        <td class="field">总价(*)：</td>
                        <td><input type="text" class="text" name="cost" id="cost" value="" readonly/></td>
                    </tr>




                    <tr>
                        <td></td>
                        <td><label class="ui-blue"><input type="button" name="button" id="btn" value="添加"/></label></td>
                    </tr>

                </table>
            </form>
        </div>
    </div>
    <div class="clear">

    </div>

</div>

<div id="footer">
    陶龙宇
</div>
<script type="text/javascript">
    $(function () {

        $("#btn").click(function () {
            alert("userbtn")
            var params = $("#myform").serialize();//获取表单参数值
            $.ajax({
                url: "${ctx}/staff/doaddstaff",
                type: "post",
                data: params,
                dataType: "json",
                success: function (result) {
                    alert(result.msg)
                    if (result.code == 10000) {
                        location.href = "${ctx}/staff/getstaffs";
                    }
                },
                error: function () {
                    alert("请联系管理员")
                },
            })


        })
    })


</script>

<script type="text/javascript">
    function maddchoice(){

        var mytable = document.getElementById("mytable")

            var mytd = document.createElement("td")
            var mytr1 = document.createElement("tr")
        mytr1.setAttribute("class","field")
        mytr1.innerHTML="选择消费项目："

   /*         var mytr2 = document.createElement("tr")
            var mytr3 = document.createElement("tr")
            var mytr4 = document.createElement("tr")*/

        mytd.appendChild(mytr1);
        mytable.appendChild(mytd)




    }

    function copyimg(){
        alert("sdlj")

        $.ajax({
            url: "${ctx}/staff/doupdatestaff",
            type: "post",
            traditional: true,
            data: {"staffname": staffname, "ids": ids, "phone": phone, "salary": salary,"staffid":staffid},
            dataType: "json",
            success: function (result) {
                alert(result.msg)
                if (result.code == 10000) {
                    location.href = "${ctx}/staff/getstaffs";
                }
            },
            error: function () {
                alert("请联系管理员")
            },


        })


    }


    function mylogo(){

    }

    /* 	function clikimg(){
            var obg = document.getElementById("testimg")
            alert(obg.getAttribute("title"))

        } */

</script>
<style type="text/css">
    .myinput{
      width: 200px;
    }
    .mytd{
       /* border: solid black;*/
        width: 20%;
    }
    .mytr{
        border-bottom:2px solid #dfc9b2;
    }
</style>
</body>
</html>
